import request from '@/utils/request'

export function queryPage(listQuery) {
  return request({
    url: '/approval/' + listQuery.url + '/page',
    method: 'post',
    params: {
      current: listQuery.page,
      size: listQuery.size,
      startTime: listQuery.startTime,
      endTime: listQuery.endTime,
      defKey: listQuery.defKey,
      userSearchStr: listQuery.userSearchStr,
      idCardSearchStr: listQuery.idCardSearchStr
    }
  })
}

export function queryLADetail(id) {
  return request({
    url: '/living-allowances/detail/' + id,
    method: 'get'
  })
}

export function queryESDetail(id) {
  return request({
    url: '/educational-support/detail/' + id,
    method: 'get'
  })
}

export function queryTaskHistory(id) {
  return request({
    url: '/approval/task/history',
    method: 'get',
    params: {
      approvalId: id
    }
  })
}

export function audit(temp) {
  return request({
    url: '/approval/task/done',
    method: 'post',
    params: {
      approvalId: temp.approvalId,
      taskId: temp.taskId,
      comment: temp.comment,
      principal: temp.principal,
      contact: temp.contact,
      result: temp.result
    }
  })
}

export function auditLast(temp,money) {
  return request({
    url: '/educational-support/task/pass',
    method: 'post',
    params: {
      approvalId: temp.approvalId,
      taskId: temp.taskId,
      comment: temp.comment,
      principal: temp.principal,
      contact: temp.contact,
      result: temp.result,
      money: money
    }
  })
}

export function queryPersonalApprovals(listQuery){
  return request({
    url: '/approval/personal-approval/' + listQuery.idCard,
    method: 'post',
    params: {
      current: listQuery.page,
      size: listQuery.size
    }
  })
}

export function queryPersonalInfo(idCard){
  return request({
    url: '/approval/personal-info/' + idCard,
    method: 'get'
  })
}

export function queryFiles(idCard){
  return request({
    url: '/approval/approval-files/' + idCard,
    method: 'get'
  })
}

export function sendUrge(phone){
  return request({
    url: '/approval/urge/' + phone,
    method: 'get'
  })
}

